<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>


<script>

  // const arr = [1, 34, 'aa', ['hello'], 99]
  // const [a, ...other] = arr
  // console.log(a)
  // console.log(other)
  // console.log(...other)
  // console.log(...document.querySelectorAll('*'))
  // console.log(...[1, 34, 23])


  // let arr = [1, 23, 0]
  // let arr1 = arr
  // let arr1 = arr.concat()
  // let arr1 = [...arr, ...arr, ...arr]
  // arr1[0] = 100
  // console.log(arr)
  // console.log(arr1)

  // let arr1 = ['a', 'b']
  // let arr3 = [100, 99]

  // console.log(arr.concat(arr1, arr3))
  // console.log([...arr, ...arr3, ...arr1])

  // let allTag = document.querySelectorAll('*')

  // 类似数组 => 数组
  // allTag = [...allTag]
  // allTag = Array.from(allTag)

  // es5
  // allTag = [].slice.call(allTag)

  // console.log(allTag.push(123))
  // console.log(allTag)

  // let arr = [1, 23, 0];
  // let arr1 = arr
  // 拷贝数组
  // let arr1 = arr.concat()
  // let arr1 = [...arr]
  // let arr1 = arr.slice()
  // console.log(arr === arr1)
  // arr1.push('最新的')
  // console.log('arr', arr)
  // console.log('arr1', arr1)
  // console.log(Array.of(1, 34, 100))

  let arr = ['奔驰', '宝马', '奥迪', '路虎', '777']

  // for (let item of arr.keys()) {
  // for (let item of arr.values()) {
  for (let item of arr.entries()) {
    console.log(item)
  }

  // let arr = new Array(10)
  // let arr = new Array(10).fill(undefined)
  // let arr = new Array(10).fill('RMB')
  // console.log(arr)

  // let arr = ['奔驰', '宝马', '奥迪', '路虎', '777']
  // console.log(arr.fill('000'))

  // console.log(arr.copyWithin(0, 2))
  // console.log(arr.copyWithin(0, 2, 4))


</script>
</body>
</html>